home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
UTIL
/
SCREEN
/
CURSES01
/
minix
/
c
/
lineins
< prev
next >
Wrap
Text File
|
1991-05-05
|
3KB
|
90 lines
/****************************************************************/
/* Winsertln() routine of the PCcurses package */
/* */
/****************************************************************/
/* This version of curses is based on ncurses, a curses version */
/* originally written by Pavel Curtis at Cornell University. */
/* I have made substantial changes to make it run on IBM PC's, */
/* and therefore consider myself free to make it public domain. */
/* Bjorn Larsson (...mcvax!enea!infovax!bl) */
/****************************************************************/
/* 1.0: Release: 870515 */
/****************************************************************/
/* Modified to run under the MINIX operating system by Don Cope */
/* These changes are also released into the public domain. */
/* 900906 */
/****************************************************************/
#include <curses.h>
#include "curspriv.h"
/****************************************************************/
/* Winsertln() inserts a blank line instead of the cursor line */
/* in window 'win' and pushes other lines down. */
/****************************************************************/
int winsertln(win)
WINDOW *win;
{
int *temp;
int *end;
short y;
static int blank;
blank = ' ' | (win->_attrs & ATR_MSK);
temp = win->_line[win->_regbottom];
for (y = win->_regbottom; y > win->_cury; y--)
{
win->_line[y] = win->_line[y-1];
win->_minchng[y] = 0;
win->_maxchng[y] = win->_maxx;
} /* for */
win->_line[win->_cury] = temp;
for (end = &temp[win->_maxx]; temp <= end; temp++)
*temp = blank;
win->_minchng[win->_cury] = 0;
win->_maxchng[win->_cury] = win->_maxx;
return(OK);
} /* winsertln */
/****************************************************************/
/* Insertln() inserts a blank line instead of the cursor line */
/* in stdscr and pushes other lines down. */
/****************************************************************/
int insertln()
{
return(winsertln(stdscr));
} /* insertln */
/****************************************************************/
/* Mvinsertln() moves the stdscr cursor to a new positions, in- */
/* serts a blank line instead of the cursor line and pushes */
/* other lines down. */
/****************************************************************/
int mvinsert(y,x)
int y;
int x;
{
if (wmove(stdscr,y,x) == ERR)
return(ERR);
return(winsertln(stdscr));
} /* mvinsert */
/****************************************************************/
/* Mvinsertln() moves the cursor in window 'win' to a new posi- */
/* tions, inserts a blank line instead of the cursor line and */
/* pushes other lines down. */
/****************************************************************/
int mvwinsert(win,y,x)
WINDOW *win;
int y;
int x;
{
if (wmove(win,y,x) == ERR)
return(ERR);
return(winsertln(win));
} /* mvwinsert */